#!/bin/sh

# replace environment variable because this version of filebeat doesn't support environment variable in the config yaml file.
# sed -i 's/\${DATAKIT_HOST}/'"${DATAKIT_HOST}"'/g' /opt/ddtrace-agent/config/agent.config
# sed -i 's/\${DATAKIT_PORT}/'"${DATAKIT_PORT}"'/g' /opt/ddtrace-agent/config/agent.config

java -javaagent:/root/dd-java-agent.jar \
         -Ddd.logs.injection=true \
         -Ddd.service=my-app \
         -Ddd.env=staging \
         -Ddd.version=1.0.0 \
         -Ddd.trace.agent.url=http://${DATAKIT_HOST}:${DATAKIT_PORT} \
         -Ddd.trace.debug=true \
         -jar /root/app.jar